package cn.edu.sdjzu.xg.eagle.bysj.service.impl;

import cn.edu.sdjzu.xg.eagle.bysj.Mapper.WupinshenlingMapper;
import cn.edu.sdjzu.xg.eagle.bysj.entity.WupinshenlingEntity;
import cn.edu.sdjzu.xg.eagle.bysj.entity.view.WupinshenlingView;
import cn.edu.sdjzu.xg.eagle.bysj.service.Interface.WupinshenlingService;
import cn.edu.sdjzu.xg.eagle.bysj.utils.PageUtils;
import cn.edu.sdjzu.xg.eagle.bysj.utils.Query;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("wupinshenlingService")
public class WupinshenlingServiceImpl extends ServiceImpl<WupinshenlingMapper, WupinshenlingEntity> implements WupinshenlingService {

    	
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<WupinshenlingEntity> page = this.selectPage(
                new Query<WupinshenlingEntity>(params).getPage(),
                new EntityWrapper<WupinshenlingEntity>()
        );
        return new PageUtils(page);
    }
    
    @Override
	public PageUtils queryPage(Map<String, Object> params, Wrapper<WupinshenlingEntity> wrapper) {
		  Page<WupinshenlingView> page =new Query<WupinshenlingView>(params).getPage();
	        page.setRecords(baseMapper.selectListView(page,wrapper));
	    	PageUtils pageUtil = new PageUtils(page);
	    	return pageUtil;
 	}
    
	@Override
	public List<WupinshenlingView> selectListView(Wrapper<WupinshenlingEntity> wrapper) {
		return baseMapper.selectListView(wrapper);
	}

	@Override
	public WupinshenlingView selectView(Wrapper<WupinshenlingEntity> wrapper) {
		return baseMapper.selectView(wrapper);
	}
	
	


}
